package cn.pinming.chyn.tools.exception;

/**
 * Create by WangSJ on 2019/03/11
 * |基础通用的错误代码
 */
public enum ChynResultCode implements ResultCode {

    //成功  通用
    SUCCESS(200, "success"),
    ERR(500, "服务器繁忙"),
    
    NO_PARAM(90001, "必填参数未填写"),
    STRING_ILLEGAL_LENGTH(90002, "字符串长度异常"),
    STRING_ILLEGAL_REGEX(90003, "字符串正则校验失败"),
    NUMBER_ILLEGAL_RANGE(90004, "数字范围异常"),
    
    DATE_FORMAT_ERR(90008, "日期格式转换失败"),
    ;


    private int code;
    private String msg;

    ChynResultCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public int getCode() {
        return this.code;
    }

    @Override
    public String getMsg() {
        return this.msg;
    }}